package net.zigin.nhi.could.waste.service;

import net.zigin.nhi.could.waste.rabbitmq.model.MessageModel;
import net.zigin.nhi.could.waste.dto.WarnBaseDto;
import net.zigin.nhi.could.waste.model.*;
import net.zigin.nhi.could.waste.vo.WarnBaseVo;
import net.zigin.nhi.could.waste.vo.WasteWarnVo;

import java.util.Date;
import java.util.List;

/*#################################################################*
# 说明:以下代码通过哲勤代码生成工具自动生成    
# 工具:GeneratorCode
# 作者:mgw1986                                                  
# 生成时间:2021-9-23 23:25:02                                               
##################################################################*/


/**
 * WarnBase服务接口类
 *
 * @author mgw1986
 * @version V1.0
 * @ClassName: WarnBaseService
 * @date 2021-9-23 23:25:02
 */
public interface WarnBaseService extends BaseService<WarnBase, String> {


    void dealWith(WarnBaseDto warnBaseDto);

    List<WarnBaseVo> getList(WarnBaseDto warnBaseDto);

    Integer getCount(WarnBaseDto warnBaseDto);

    /**
     * 检查超重规则
     *
     * @param step            collect in out
     * @param wasteClassifyId 医废分类code
     * @param oldWeight       原重量
     * @param newWeight       现重量
     */
    String checkWeightRule(String step, String wasteClassifyId, Float oldWeight, Float newWeight);

    /**
     * 超重预警
     * @param wasteBase
     * @param warnType
     */
    void generateWarn(WasteBase wasteBase, String warnType);

    /**
     * 出入库超时预警
     * @param wasteBase 医废
     * @param messageModel 消息
     */
    void generateWarn(WasteBase wasteBase, MessageModel messageModel);

    /**
     * 箱超重预警
     * @param wasteBox 医废箱
     * @param wasteBoxRecord 医废箱记录
     * @param warnType 预警类型
     * @param wasteBoxCode 箱编号
     */
    void generateWarn(WasteBox wasteBox, WasteBoxRecord wasteBoxRecord, String warnType, String wasteBoxCode);

    /**
     * 获取预警信息
     * @param wasteBaseId 医废id
     * @return
     */
    WasteWarnVo getWarnTimeAndWeight(String wasteBaseId);

    /**
     * 收集超时预警
     * @param hospitalDepart 科室
     * @param messageModel 消息
     * @param lastCollectTime 上次收集时间
     */
    void generateCollectWarn(HospitalDepart hospitalDepart, MessageModel messageModel, Date lastCollectTime);

}
